#!/bin/bash

#Update sources.list
echo -e '\e[5;44;32m更新软件源\e[0m'
#sudo mv /etc/apt/sources.list /etc/apt/sources.list.backup
#sudo cp ./sources.list /etc/apt/sources.list
sudo apt-get update
sudo apt-get upgrade
#tools
echo -e '\e[5;44;32m安装linux工具\e[0m'
# 更多工具参见：https://gitee.com/karl1864/linux
# man 中文帮助 https://www.cnblogs.com/phpfudao/p/7420806.html
sudo apt install fzf
sudo apt install silversearcher-ag
sudo apt install tldr
sudo apt install ranger
sudo apt install manpages-zh
# 图片查看工具
sudo apt install chafa
# 文本浏览器
sudo apt install lynx
sudo touch ~/模板/文本文件
sudo apt install net-tools -y
sudo apt install ethtool -y

# wsl fish 出问题参考 https://blog.csdn.net/lrwwll/article/details/107310997 重新挂载c盘
# sudo umount /mnt/c
# sudo mount -t drvfs c:\\ /mnt/c

sudo apt install fish -y
sudo apt install vim-gtk -y
sudo apt install gcc -y
sudo apt install wget -y
sudo apt install git -y
sudo apt install tree -y
sudo apt install synaptic -y
sudo apt install curl -y
sudo apt-get install rar -y
sudo apt-get install unrar -y
chsh -s /usr/bin/fish
sudo usermod -s /usr/bin/fish $USER
#set fish_greeting 'Talk is cheap. Show me the code.'
echo -e '\e[5;44;32m安装Typora\e[0m'
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
sudo apt-get install typora
echo -e '\e[5;44;32m安装jdk11\e[0m'
#java11
sudo apt install openjdk-11-jdk -y
#tomcat
sudo mkdir ~/env
echo -e '\e[5;44;32m拷贝tomcat9到~/env/\e[0m'
sudo cp -r ./apache-tomcat-9.0.50/ ~/env/tomcat-9.0.5/
#maven
echo -e '\e[5;44;32m拷贝maven3.6到~/env/\e[0m'
sudo cp -r ./apache-maven-3.6.3/ ~/env/maven-3.6.3/
#install mysql
echo -e '\e[5;44;32m安装mysql数据库\e[0m'
sudo apt install mysql-server -y
sudo gpasswd -a $USER mysql
sudo apt install pip -y
echo -e '\e[5;44;32m安装mycli\e[0m'
sudo apt install mycli -y
pip install pymysql==0.9.2
echo -e '\e[5;44;32m安装firefox中文版\e[0m'
#firefox
sudo apt-get install firefox-locale-zh-hans -y
#vscode
sudo dpkg -i code.deb
echo -e '\e[5;44;32m安装Windows软件\e[0m'
#Windows softwares
sudo sh ./deepin-wine-for-ubuntu/install.sh
sudo dpkg -i *.deb
echo -e '\e[5;44;32m复制文档\e[0m'
sudo cp ./doc/*.pdf ~/文档/
sudo cp ./推荐软件 ~/桌面/
echo -e '\e[5;44;32m安装node.js\e[0m'
sudo apt install nodejs -y
sudo apt install npm -y
# node.js版本管理
sudo npm install -g n
sudo n latest
# npm init @vitejs/app <project-name>
echo -e '\e[5;44;32m安装docker\e[0m'
#sudo groupadd docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
#sudo apt --purge remove docker-ce docker-ce-cli containerd.io
#sudo apt install docker-ce docker-ce-cli containerd.io
sudo gpasswd -a $USER docker
#sudo service docker start


echo -e '\e[5;44;32m安装rustc\e[0m'
sudo apt install rustc
echo -e '\e[5;44;32m安装golang\e[0m'
sudo apt install golang

echo -e '\e[5;44;32m初始化完成\e[0m'
read -p "是否要现在重启[y/n]" a
if [ "$a" = "y" ]; then
	reboot
fi
